﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DBUtil.Entity
{
    public class ColumnInfo
    {
        /// <summary>
        /// √
        /// </summary>
        public string PKMark { get; set; }

        /// <summary>
        /// √
        /// </summary>
        public string IdentityMark { get; set; }

        /// <summary>
        /// √
        /// </summary>
        public string CanNullMark { get; set; }



        /// <summary>
        /// 序号
        /// </summary>
        public int Colorder
        {
            get;
            set;
        }

        /// <summary>
        /// 列名
        /// </summary>
        public string ColumnName
        {
            get;
            set;
        }

        /// <summary>
        /// 列描述
        /// </summary>
        public string DeText
        {
            get;
            set;
        }


        /// <summary>
        /// 类型名称
        /// </summary>
        public string TypeName
        {
            get;
            set;
        }

        /// <summary>
        /// 字段长度
        /// </summary>
        public int? Length
        {
            get;
            set;
        }

        /// <summary>
        /// 类型总长度
        /// </summary>
        public int? Preci
        {
            get;
            set;
        }
        /// <summary>
        /// 小数点后保留位数
        /// </summary>
        public int? Scale
        {
            get;
            set;
        }

        private bool _isIdentity = false;
        /// <summary>
        /// 是否自增列
        /// </summary>
        public bool IsIdentity
        {
            get
            {
                if (IdentityMark == "√")
                {
                    _isIdentity = true;
                }
                return _isIdentity;
            }
            set
            {
                _isIdentity = value;
            }
        }

        private bool _isPK = false;

        /// <summary>duigou
        /// 是否主键
        /// </summary>
        public bool IsPK
        {
            get
            {
                if (PKMark == "√")
                {
                    _isPK = true;
                }
                return _isPK;
            }
            set
            {
                _isPK = value;
            }
        }

        private bool _canNull = false;

        /// <summary>
        /// 是否可以为null
        /// </summary>
        public bool CanNull
        {
            get
            {
                if (CanNullMark == "√")
                {
                    _canNull = true;
                }
                return _canNull;
            }
            set
            {
                _canNull = value;
            }
        }

        /// <summary>
        /// 默认值
        /// </summary>
        public string DefaultVal
        {
            get;
            set;
        }



        /// <summary>
        /// 列创建时间
        /// </summary>
        public DateTime? Create_Date
        {
            get;
            set;
        }

        /// <summary>
        /// 列修改时间
        /// </summary>
        public DateTime? Modify_Date
        {
            get;
            set;
        }

        /// <summary>
        /// 索引名称
        /// </summary>
        public string IndexName
        {
            get;
            set;
        }

        /// <summary>
        /// 索引排序规则
        /// </summary>
        public string IndexSrot
        {
            get;
            set;
        }

    }
}
